@extends('layouts.admin')
@section('title','商品类型管理')


@section('content')
    
    <!-- Main content -->
    <section class="content">
      <div class="col-md-6" style="width: 100%">
          <!-- Horizontal Form -->
          <div class="box box-info">
            <div class="box-header with-border">
             
            </div>
            <!-- /.box-header -->
            <!-- form start -->
            <form class="form-horizontal" action="{{route('admin.category.update')}}">
              {{ csrf_field() }}
              <input type="hidden" name="id" value="{{$cat->id}}">
              <div class="box-body">
                <div class="form-group">
                  <label for="inputEmail3" class="col-sm-2 control-label">分类名称</label>

                  <div class="col-sm-10">
                    <input type="text" class="form-control" name="name" id="inputEmail3" placeholder="分类名称" value="{{$cat->name}}">
                  </div>
                </div>
                <div class="form-group">
                  <label for="inputEmail3" class="col-sm-2 control-label">分类关键字</label>

                  <div class="col-sm-10">
                    <input type="text" class="form-control" name="tags" id="inputEmail3" placeholder="关键字" value="{{$cat->tags}}">
                  </div>
                </div>
                <div class="form-group">
                  <label for="inputEmail3" class="col-sm-2 control-label">分类描述</label>

                  <div class="col-sm-10">
                    <textarea class="form-control" rows="3" name="description" placeholder="描述" value="{{$cat->description}}">{{$cat->name}}</textarea>
                  </div>
                </div>

                <div class="form-group">
                  <label for="inputEmail3" class="col-sm-2 control-label">所属父类</label>

                  <div class="col-sm-10">
                  <select multiple="" class="form-control" name="parent_id">
                    <option value="0">无</option>
                    @foreach($category as $v)
                    <option value="{{$v['id']}}" @if($v['id']==$cat->parent_id) selected="selected" @endif>{{$v['name']}}</option>
                    @endforeach
                  </select>
                  </div>
                </div>
               
              </div>
              <!-- /.box-body -->
              <div class="box-footer">
                <button type="submit" class="btn btn-default" onClick="javascript:history.back()">返回</button>
                <button type="button" class="btn btn-info pull-right btn-submit">提交</button>
              </div>
              <!-- /.box-footer -->
            </form>
          </div>
          <!-- /.box -->
          <!-- general form elements disabled -->
     
          <!-- /.box -->
        </div>
    </section>
    <!-- /.content -->
 


@endsection